import { Elysia, t } from 'elysia';

import { userController } from '@/controllers/user';

/**
 * API 路由配置
 */
export const apiRoutes = new Elysia()
  .get(
    '/health',
    () => ({
      status: 'healthy',
      timestamp: new Date().toISOString(),
    }),
    {
      responses: {
        200: {
          description: '服务正常运行',
          body: t.Object({
            status: t.String(),
            timestamp: t.String(),
          }),
        },
      },
      detail: {
        summary: '健康检查',
        description: '健康检查接口',
        tags: ['系统监控'],
      },
    }
  )
  .group(`/api/v1`, app => app.use(userController));
